BINARY_NAME=ruov
VERSION=v1.0.beat
RACE=-ldflags="-s -w -X "nodemessage.com/ruov-cli/builder.VERSION=${VERSION}""

.PHONY: all
all: win linux

.PHONY: linux
linux:
	GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(RACE) -o ./bin/linux/$(BINARY_NAME) ./main.go

.PHONY: win
win:
	GOOS=windows GOARCH=amd64 go build $(RACE) -o ./bin/win/$(BINARY_NAME).exe ./main.go

install:
	go mod tidy

.PHONY: pack
pack:
	upx -9  ./bin/win/$(BINARY_NAME).exe
	upx -9 ./bin/linux/$(BINARY_NAME)

build: win linux